var searchArray = {};
searchArray["CONTEXT"] = "-内容-";
searchArray["TITLE"] = "-标题-";
searchArray["FJ"] = "-附件-";
searchArray["BIDDINGNO"] = "招标编号";

var tableArray = {};


var areaArray = new Array();
areaArray[0] = "";
areaArray[41] = "北京";
areaArray[42] = "天津";
areaArray[43] = "河北";
areaArray[44] = "山西";
areaArray[45] = "内蒙古";
areaArray[46] = "上海";
areaArray[47] = "山东";
areaArray[48] = "江苏";
areaArray[49] = "安徽";
areaArray[50] = "江西";
areaArray[51] = "浙江";
areaArray[52] = "福建";
areaArray[53] = "湖北";
areaArray[54] = "湖南";
areaArray[55] = "河南";
areaArray[56] = "广东";
areaArray[57] = "广西";
areaArray[58] = "海南";
areaArray[59] = "辽宁";
areaArray[60] = "吉林";
areaArray[61] = "黑龙江";
areaArray[62] = "陕西";
areaArray[63] = "甘肃";
areaArray[64] = "宁夏";
areaArray[65] = "新疆";
areaArray[66] = "青海";
areaArray[67] = "重庆";
areaArray[68] = "四川";
areaArray[69] = "贵州";
areaArray[70] = "云南";
areaArray[71] = "西藏";
areaArray[72] = "香港";


var categoryArray = new Array();
categoryArray[0] = "";


var dateArray = {};





function kai() {
    var w = $(document.body).width();
    var h = $(document.body).height();
    $("#hui").css({"width": w, "height": h + 40}); //灰屏高度不够
    $("#hui").css("display", "block");
}
function guan() {
    $("#hui").css("display", "none");
}

function search_type_hx(search_type) {
    $("#search_x").text(searchArray[search_type]);
    $("#search_type").val(search_type);
}
var search_b = false;
function search_click(search_z) {
    if (search_z == 0) {
        search_z = $("#search_type").val();
    }

    if (search_b) {
        $("#dialog-search").hide();
        $("#search_x").removeClass();
        $("#search_x").addClass("neir fl");
        search_b = false;
    } else {
        $("#dialog-search").show();
        $("#search_x").removeClass();
        $("#search_x").addClass("neir_x fl");
        search_b = true;
    }
    $("#search_x").text(searchArray[search_z]);
    $("#search_type").val(search_z);
}

function changeBegin() {
    $("#text_x").hide();
    $("#text").show();
    $("#text").focus();
}

function  table_type_hx(table_type) {
    var nnn = $("[name='table']");
    var nn = nnn.length;
    var nu = new Array();
    nu = table_type.split(",");
    var n = nu.length;
    var str = "";
    var str1 = "";
    var num = 0;
    if (n == 1) {
        $("#table_x").text("请选择：栏目");
        $("#table_x").attr('title', "");
        $("#table_type").val("");
        $("[name='table']").removeAttr("checked");
        $("#table_x").removeClass();
        $("#table_x").addClass("quanxuan fl");
    } else {
        for (i = 0; i < n - 1; i++) {
            str1 += tableArray[nu[i]] + " ";
            num += 1;
            $("[name='table']").each(function () {
                if ($(this).val() == nu[i]) {
                    $(this).prop("checked", 'true');
                }
            });
        }
//                    $("#table_x").text("已选择："+tableArray[nu[0]] + " ...");
        $("#table_x").text("栏目已选：" + num + "项");
        $("#table_x").attr('title', str1);
        $("#table_type").val(table_type);
        $("#table_x").removeClass();
        $("#table_x").addClass("quanxuan_end fl");
    }
}

var type_b = false;
function type_x() {
    if (type_b) {
        $("#dialog-table").hide();
        type_b = false;
        guan();
    } else {
        $("#dialog-table").show();
        type_b = true;
        kai();
    }
}

function qd_table() {
    var n = $("[name='table']:checked").length;
    var str = "";
    var str1 = "";
    var num = 0;
    if (n == 7) {
        $("#table_x").text("栏目：全选");
        $("#table_x").attr('title', "");
        $("#table_type").val("");
        $("#table_x").removeClass();
        $("#table_x").addClass("quanxuan_end fl");
    } else if (n == 0) {
        $("#table_x").text("请选择：栏目");
        $("#table_x").attr('title', "");
        $("#table_type").val("");
        $("#table_x").removeClass();
        $("#table_x").addClass("quanxuan fl");
    } else {
        $("[name='table']:checked").each(function () {
            str1 += tableArray[$(this).val()] + " ";
            str += $(this).val() + ",";
            num += 1;
        });
//                    var nu = new Array();
//                    nu = str1.split(" ");
        $("#table_x").text("栏目已选：" + num + "项");
        $("#table_x").attr('title', str1);
        $("#table_type").val(str);
        $("#table_x").removeClass();
        $("#table_x").addClass("quanxuan_end fl");
    }
    $("#dialog-table").hide();
    type_b = false;
    guan();
}

function qx_table() {
    $("#dialog-table").hide();
    type_b = false;
    guan();
}
function quan_table() {
    $("[name='table']").prop("checked", 'true');
}
function fan_table() {
    $("[name='table']").each(function () {
        if ($(this).attr("checked")) {
            $(this).removeAttr("checked");
        } else {
            $(this).prop("checked", 'true');
        }
    });
}

function  areaid_hx(area) {
    var nnn = $("[name='area']");
    var nn = nnn.length;
    var nu = new Array();
    nu = area.split(",");

    var n = nu.length;
    var str = "";
    var str1 = "";
    var num = 0;
    if (n == 1) {
        $("#area_x").text("请选择：地区");
        $("#area_x").attr('title', "");
        $("#areaid").val("");
        $("[name='area']").removeAttr("checked");
        $("#area_x").removeClass();
        $("#area_x").addClass("quanxuan fl");
    } else {
        for (i = 0; i < n - 1; i++) {
            str1 += areaArray[nu[i]] + "+";
            num += 1;
            $("[name='area']").each(function () {
                if ($(this).val() == nu[i]) {
                    $(this).prop("checked", 'true');
                }
            });
        }
	 $("#areaid").val(area);
        $("#area_x").attr('title', str1);
        $("#area_x").text("地区已选：" + num + "项");
       // $("#area_x").removeClass();
        //$("#area_x").addClass("quanxuan_end fl");
    }
}
var area_b = false;
function area_click() {
    if (area_b) {
        $("#dialog-area").hide();
        area_b = false;
        guan();
    } else {
        $("#dialog-area").show();
        area_b = true;
        kai();
    }
}
function qd_area() {
	
    var n = $("[name='area']:checked").length;
    var str = "";
    var str1 = "";
    var num = 0;
    if (n == 36) {
        $("#area_x").text("地区：全选");
        $("#area_x").attr('title', "");
        $("#areaid").val("");
        //$("#area_x").removeClass();
        //$("#area_x").addClass("quanxuan_end fl");
    } else if (n == 0) {
        $("#area_x").text("请选择：地区");
        $("#area_x").attr('title', "");
        $("#areaid").val("");
       // $("#area_x").removeClass();
       // $("#area_x").addClass("quanxuan fl");
    } else {
        $("[name='area']:checked").each(function () {
            if (areaArray[$(this).val()] == null) {
            } else {
				
                str1 += areaArray[$(this).val()] + " ";
                str +="("+$(this).val() + "),";
                num += 1;
            }
        })
		
        $("#areaid").val(str);
        $("#area_x").attr('title', str1);
//                    var nu = new Array();
//                    nu = str1.split(" ");
        $("#area_x").text("地区已选：" + num + "项");
        //$("#area_x").removeClass();
       // $("#area_x").addClass("quanxuan_end fl");
    }
    $("#dialog-area").hide();
    area_b = false;
    guan();
}
function qx_area() {
    $("#dialog-area").hide();
    area_b = false;
    guan();
}
function quan_area() {
    $("[name='area']").prop("checked", 'true');
}
function fan_area() {
    $("[name='area']").each(function () {
        if ($(this).prop("checked")) {
            $(this).removeAttr("checked");
        } else {
            $(this).prop("checked", 'true');
        }
    });
}
function area_l1() {
	 if ($("#l1 :checkbox").length == $("#l1 :checkbox:checked").length) {
        $("#l1 :checkbox").removeAttr("checked",'false');
    } else {
        $("#l1 :checkbox").prop("checked", 'true');
    }
}
function area_l2() {
    if ($("#l2 :checkbox").length == $("#l2 :checkbox:checked").length) {
        $("#l2 :checkbox").removeAttr("checked");
    } else {
        $("#l2 :checkbox").prop("checked", 'true');
    }
}
function area_l3() {
    if ($("#l3 :checkbox").length == $("#l3 :checkbox:checked").length) {
        $("#l3 :checkbox").removeAttr("checked");
    } else {
        $("#l1 :checkbox").prop("checked", 'true');
    }
}
function area_l3() {
    if ($("#l3 :checkbox").length == $("#l3 :checkbox:checked").length) {
        $("#l3 :checkbox").removeAttr("checked");
    } else {
        $("#l3 :checkbox").prop("checked", 'true');
    }
}
function area_l4() {
    if ($("#l4 :checkbox").length == $("#l4 :checkbox:checked").length) {
        $("#l4 :checkbox").removeAttr("checked");
    } else {
        $("#l4 :checkbox").prop("checked", 'true');
    }
}
function area_l5() {
    if ($("#l5 :checkbox").length == $("#l5 :checkbox:checked").length) {
        $("#l5 :checkbox").removeAttr("checked");
    } else {
        $("#l5 :checkbox").prop("checked", 'true');
    }
}
function area_l6() {
    if ($("#l6 :checkbox").length == $("#l6 :checkbox:checked").length) {
        $("#l6 :checkbox").removeAttr("checked");
    } else {
        $("#l6 :checkbox").prop("checked", 'true');
    }
}
function area_l7() {
    if ($("#l7 :checkbox").length == $("#l7 :checkbox:checked").length) {
        $("#l7 :checkbox").removeAttr("checked");
    } else {
        $("#l7 :checkbox").prop("checked", 'true');
    }
}
function area_l8() {
    if ($("#l8 :checkbox").length == $("#l8 :checkbox:checked").length) {
        $("#l8 :checkbox").removeAttr("checked");
    } else {
        $("#l8 :checkbox").prop("checked", 'true');
    }
}
function categoryid_hx(categoryid) {
    if (categoryid.lastIndexOf(",") == categoryid.length - 1) {
        categoryid = categoryid.substring(0, categoryid.length - 1);
    }
    var nu = new Array();
    nu = categoryid.split(",");
    var n = nu.length;
    var str1 = "";
    var num = 0;
    if (n == 1 && nu[0] == "") {
        $("#category_x").text("请选择：行业");
        $("#category_x").attr('title', "");
        $("#categoryid").val("");
        $("[name='category']").removeAttr("checked");
        //$("#category_x").removeClass();
        //$("#category_x").addClass("quanxuan fl");
    } else {
        for (i = 0; i < n; i++) {
            str1 += categoryArray[nu[i]] + " ";
            num += 1;
            $("[name='category']").each(function () {
                if ($(this).val() == nu[i]) {
                    $(this).prop("checked", 'true');
                }
            });
        }
        $("#categoryid").val(categoryid);
        $("#category_x").attr('title', str1);
        $("#category_x").text("行业已选：" + num + "项");
       // $("#category_x").removeClass();
       // $("#category_x").addClass("quanxuan_end fl");
    }
}

var category_b = false;
function category_click() {
    if (category_b) {
        $("#dialog-category").hide();
        category_b = false;
        guan();
    } else {
        $("#dialog-category").show();
        category_b = true;
        kai();
    }
}
function qd_category() {
    var n = $("[name='category']:checked").length;
    var str = "";
    var str1 = "";
    var num = 0;
    if (n == 17) {
        $("#category_x").text("行业：全选");
        $("#category_x").attr('title', "");
        $("#categoryid").val("");
       // $("#category_x").removeClass();
        //$("#category_x").addClass("quanxuan_end fl");
    } else if (n == 0) {
        $("#category_x").text("请选择：行业");
        $("#category_x").attr('title', "");
        $("#categoryid").val("");
        //$("#category_x").removeClass();
        //$("#category_x").addClass("quanxuan fl");
    } else {
        $("[name='category']:checked").each(function () {
            str1 += categoryArray[$(this).val()] + " ";
            str += "("+$(this).val() + "),";
            num += 1;
        });
        $("#categoryid").val(str);
        $("#category_x").attr('title', str1);
//                    var nu = new Array();
//                    nu = str1.split(" ");
        $("#category_x").text("行业已选：" + num + "项");
       // $("#category_x").removeClass();
        //$("#category_x").addClass("quanxuan_end fl");
    }
    $("#dialog-category").hide();
    category_b = false;
    guan();
}
function qx_category() {
    $("#dialog-category").hide();
    category_b = false;
    guan();
}
function quan_category() {
    $("[name='category']").prop("checked", 'true');
}
function fan_category() {
    $("[name='category']").each(function () {
        if ($(this).prop("checked")) {
            $(this).removeAttr("checked");
        } else {
            $(this).prop("checked", 'true');
        }
    })
}

function b_date_hx(b_date) {
    $("#date_x").text(dateArray[b_date]);
    $("#b_date").val(b_date);
}
var date_b = false;
function date_click(date_z) {

    if (date_z == 0) {
        date_z = $("#b_date").val();
    }

    if (date_b) {
        $("#dialog-date").hide();
        $("#date_x").removeClass();
        $("#date_x").addClass("neir fl");
        date_b = false;
    } else {
        $("#dialog-date").show();
        $("#date_x").removeClass();
        $("#date_x").addClass("neir_x fl");
        date_b = true;
    }
    $("#date_x").text(dateArray[date_z]);
    $("#b_date").val(date_z);
}
$(function () {
    $("body").bind({
        mousedown: function (e) {
            var targ;
            if (!e) {
                var e = window.event;
            }
            if (e.target) {
                targ = e.target;
            } else if (e.srcElement) {
                targ = e.srcElement;
            }
            if (targ.nodeType == 3) {
            }
            var tname;
            tname = targ.tagName;
            if (targ.id != "search_x" && targ.id != "date_x") {
                if (tname != "A") {
                    $("#dialog-date").hide();
                    $("#date_x").removeClass();
                    $("#date_x").addClass("neir fl");
                    date_b = false;
                    $("#dialog-search").hide();
                    $("#search_x").removeClass();
                    $("#search_x").addClass("neir fl");
                    search_b = false;
                }
            }
        }
    });
    $("#text").bind({
        blur: function () {
            var key = $("#text").val();
            if (key == "") {
                $("#text_x").show();
                $("#text").hide();
                $("#text_x").val("输入您想查找的关键词 多个词可以输入空格隔开！");
            }
        }
    });

    //支持回车键
    $("#searchgjForm").keyup(function (event) {
        if (event.keyCode == 13) {
            submitForm();
        }
    });
});

//提交form表单
function submitForm() {
//    if(document.getElementById("text_x")){
//        var str = document.getElementById("text_x").value;
//        if(str!=""){
//            $("#text_x").attr("disabled","true");
//        }
//    } 
    document.getElementById("searchgjForm").submit();
}

$(function () {
    if ($("#s_type").val() == "0") {
        var table_type = $("#table_type").val();
        var keywords = $("#text").val();
        var search_type = $("#search_type").val();
        var areaid = $("#areaid").val();
        var categoryid = $("#categoryid").val();
        var b_date = $("#b_date").val();

        table_type_hx(table_type);
        //keywords_hx(keywords);
        search_type_hx(search_type);
        areaid_hx(areaid);
        categoryid_hx(categoryid);
        b_date_hx(b_date);
    }
});

//保存搜索条件
function saveCondition() {
//    setTip1();
    var da = new Date();
    $.post('/cblcn/Home/logincheck', 't:' + da.getTime(), function (date) {
        if (date == null || date == "" || date.login_id == "") {
            xsdl();
            return;
        } else {
            $("#savec_btn").attr("disabled", 'true');
            jQuery.ajax({
                async: false,
                type: "post",
                data: {
                    "s_type": $("#s_type").val()
                },
                url: "/search/searchgj/searchConNum",
                success: function (msg) {
                    if (date.cust_right_group == "0") {
                        if (msg >= 3) {
                            alert("免费会员最多保存3个搜索条件");
                            $("#savec_btn").removeAttr("disabled");
                        } else {
                            realSave();
                        }
                    }
                    if (date.cust_right_group == "1" || date.cust_right_group == "2" || date.cust_right_group == "3") {
                        if (msg >= 10) {
                            alert("最多保存10个搜索条件");
                            $("#savec_btn").removeAttr("disabled");
                        } else {
                            realSave();
                        }
                    }
                }
            });
        }
    });
}

function realSave() {
    var s_type = $("#s_type").val();
    var logid = $("#logid").val();
    var table_type = $("#table_type").val();
    if (table_type == "") {
        table_type = "0";
    }
    var text = $("#text").val();
    var search_type = $("#search_type").val();
    var areaid = $("#areaid").val();
    if (areaid == "") {
        areaid = "0";
    }
    var categoryid = $("#categoryid").val();
    if (categoryid == "") {
        categoryid = "0";
    }
    var b_date = $("#b_date").val();
    if (b_date == "") {
        b_date = "week";
    }
    if (s_type == "0") {
//        if(table_type + text + areaid + categoryid ==""){
//            //alert("请至少选择两个条件！");
//            $("#savec_btn").removeAttr("disabled");
//        }else{
        var conditionText = getConditionText();
        //先判断是否已经保存过
        jQuery.ajax({
            type: "post",
            data: {
                "s_type": $("#s_type").val(),
                "conditionText": conditionText
            },
            url: "/search/searchgj/hasCondition",
            success: function (msg) {
                if (msg == "true") {
                    alert("你已经保存过该条件");
                    flag = true;
                    $("#savec_btn").removeAttr("disabled");
                } else {

                    jQuery.ajax({
                        type: "post",
                        data: {
                            "table_type": table_type,
                            "keywords": text,
                            "search_type": search_type,
                            "areaid": areaid,
                            "categoryid": categoryid,
                            "b_date": b_date,
                            "conditionText": conditionText,
                            "s_type": 0,
                            "logid": logid
                        },
                        url: "/search/searchgj/saveCondition",
                        success: function (msj) {
                            if (msj != "error") {
                                $("#savec_btn").removeAttr("disabled");
                                setTimeout(loadCondition(), 1500);
                            }
                        }
                    });
                }
            }
        });
    }
}

function getConditionText() {
    var s_type = $("#s_type").val();
    var conditionText = "";
    if (s_type == "0") {
        if ($("#text").val() != "") {
            conditionText = conditionText + $("#text").val() + "+ ";
        }
        if ($("#table_x").attr("title") != "") {
            conditionText = conditionText + $("#table_x").attr("title") + "+ ";
        } else {
            conditionText = conditionText + "全部栏目+ ";
        }
        if ($("#search_x").text() != "") {
            conditionText = conditionText + $("#search_x").text().replace(/-/g, "") + "+ ";
        }
        if ($("#area_x").attr("title") != "") {
            conditionText = conditionText + $("#area_x").attr("title") + "+ ";
        } else {
            conditionText = conditionText + "全部地区+ ";
        }
        if ($("#category_x").attr("title") != "") {
            conditionText = conditionText + $("#category_x").attr("title") + "+ ";
        } else {
            conditionText = conditionText + "全部行业+ ";
        }
        conditionText = conditionText.replace("++", "+");
        conditionText = conditionText + $("#date_x").text();
        return conditionText;
    }
}


$(function () {
    var da = new Date();
    $.post('/cblcn/Home/logincheck', 't:' + da.getTime(), function (date) {
        if (date == null || date == "" || date.login_id == "") {
            $("#searchC").hide();
        } else {
            loadCondition();
            sczt();
        }
    });
});

//加载已经保存的条件
function loadCondition() {
    jQuery.ajax({
        async: false,
        type: "post",
        data: {
            "s_type": $("#s_type").val(),
            "t": new Date().getTime()
        },
        url: "/search/searchgj/searchCondition",
        dataType: "json",
        success: function (msg) {
            if (msg == "empty") {
                $("#searchC").empty();
                $("#searchC").hide();
            } else {
                $("#searchC").empty();
                var html = "";
                for (var x in msg) {
                    //var short = msg[x].conditionText.length > 12 ? msg[x].conditionText.substring(0,12) + "..." : msg[x].conditionText;
                    var short = msg[x].shortText;
//                  var html = "<a title='"+msg[x].conditionText+"'   href='javascript:goSearch("+msg[x].conditionSearch+");' class='param-selected'>"+short+"<span class='close-icon'><img src='/public/search/searchadvzbxx/test/images/x_03.jpg' onclick='closeT("+msg[x].idstr+");'/></span></a>";
                    html += "<span class='param-selected' onmouseover='setImg(this);' onmouseout='setImg2(this);'><a  href='javascript:goSearch(" + msg[x].conditionSearch + ");' title='" + msg[x].conditionText + "'>" + short + " </a><span class='close-icon'><img title='删除' onclick='closeT(" + msg[x].idstr + ",this);' src='/public/search/searchadvzbxx/test/images/x_03.jpg' style='cursor:pointer;'/></span></span>";
                }
                $("#searchC").append(html);
            }
        }
    });
}

function goSearch(condition_search) {
    var lans = condition_search.split("#");
    if (lans[0] == "0") {
        $("#text_x").show();
        $("#text").val("");
    } else {
        $("#text_x").hide();
        $("#text").val(lans[0]);
    }
    if (lans[1] == "0") {
        $("#table_type").val("");
    } else {
        $("#table_type").val(lans[1]);
    }
    if (lans[2] == "0") {
        $("#search_type").val("");
    } else {
        $("#search_type").val(lans[2]);
    }

    if (lans[3] == "0") {
        $("#areaid").val("");
    } else {
        $("#areaid").val(lans[3]);
    }

    if (lans[4] == "0") {
        $("#categoryid").val("");
    } else {
        $("#categoryid").val(lans[4]);
    }
    $("#b_date").val(lans[5]);
    document.getElementById("searchgjForm").submit();
}

function closeT(id, obj) {
    if (window.confirm("删除后条件将无法找回，您可以重新设置保存")) {
        jQuery.ajax({
            type: "post",
            data: {
                "id": id
            },
            url: "/search/searchgj/delCon",
            success: function (msg) {
                if (msg == "true") {
                    $(obj).parent().parent().remove();
                    setTimeout(loadCondition(), 2000);
                    //loadCondition();
                }
            }
        });
    }
}

function sczt() {
    var objs = $(".x_job");
    var info_ids = new Array();
    if (objs.length > 0) {
        for (var i = 0; i < objs.length; i++) {
            var id = $(objs[i]).val();
            info_ids.push(id);
        }
        jQuery.ajax({
            async: false,
            type: "post",
            data: {
                "info_ids": info_ids
            },
            url: "/cblcn/busiroom/hasSC3",
            success: function (msg) {
                if (msg) {
                    var strs = msg.split("#");
                    for (var x in strs) {
                        $("#sc" + strs[x]).parent().find("td[id='sc_yes']").show();
                        $("#sc" + strs[x]).parent().find("td[id='sc_no']").hide();
                    }
                }
            }
        });
    }
}


//收藏信息
function scInfo(info_id, obj) {
    //判断是否登录
    jQuery.ajax({
        async: false,
        type: "post",
        url: "/cblcn/Home/logincheck",
        success: function (msg) {
            if (msg == null || msg == "" || msg.login_id == "") {
                xsdl();
            } else {
                $(obj).attr("disabled", "true");
                jQuery.ajax({
                    async: false,
                    type: "post",
                    data: {
                        "info_ids": info_id
                    },
                    url: "/cblcn/busiroom/collectInfo",
                    dataType: "text",
                    success: function (msg) {
                        if (msg == 'true') {
                            $(obj).parent().hide();
                            $(obj).parent().next().show();
                        } else {
                            alert("您已收藏过该信息!");
                            $(obj).parent().hide();
                            $(obj).parent().next().show();
                        }
                        $(obj).removeAttr("disabled");
                    }
                });
            }
        }
    });
}

//取消收藏
function qxSCInfo(info_id, obj) {
    $(obj).attr("disabled", "true");
    jQuery.ajax({
        type: "post",
        data: {
            "info_ids": info_id
        },
        url: "/cblcn/busiroom/qxSCInfo",
        dataType: "text",
        success: function (msg) {
            $(obj).parent().hide();
            $(obj).parent().prev().show();
            $(obj).removeAttr("disabled");
        }
    });
}

//收藏滑动过后变颜色
$(function () {
    $(".x_sc").hover(function () {
        $(this).find("img").attr("src", "/public/search/searchadvzbxx/test/images/souc_hua_h.jpg");
        $(this).find("span").css("color", "#ce5a0d");
    },
            function () {
                $(this).find("img").attr("src", "/public/search/searchadvzbxx/test/images/souc_11.jpg");
                $(this).find("span").css("color", "#000");
            });

    //为提示按钮适应位置
//    alert(" w1= " + screen.width);
//    alert(" document-w = " + $(document).width());
//    alert(" window-w= " + $(window).width());
    var offleft = $("#g_zheng").offset().left;
    $("#ts1").css("left", offleft + 575);
    $("#ts2").css("left", offleft + 785);
//       checkCache();
    window.onresize = function () {
        //alert( $(document).width() );
    };
//    var w = $(document)
//    
//    $("#ts1").
});

function setImg(obj) {
    $(obj).find("img").attr("src", "/public/search/searchadvzbxx/test/images/x1_07.jpg");
}
function setImg2(obj) {
    $(obj).find("img").attr("src", "/public/search/searchadvzbxx/test/images/x_03.jpg");
}

//提示
function setTip1() {
    //根据用户是否第一次来到这个页面来判断是否显示引导
    //判断依据：用户来过了会留下cookie，根据cookie判断
    var key1 = "GJ65SDEFU1203TCHK1";
    var cookieVal1 = $.cookie(key1);
    if (!cookieVal1) {
        //document.cookie = key + "=" + escape($("#loginId").val()) + "; expires=-1" +";path=/";
        $.cookie(key1, "sunshine", {expires: 5 * 365, path: '/', secure: false});
        $("#ts1").hide();
    }
}

function setTip2() {
    var key2 = "GJ65SDEFU1203TCHK2";
    var cookieVal2 = $.cookie(key2);
    if (!cookieVal2) {
        //document.cookie = key + "=" + escape($("#loginId").val()) + "; expires=-1" +";path=/";
        $.cookie(key2, "luckyman", {expires: 5 * 365, path: '/', secure: false});
        $("#ts2").hide();
    }
}

function checkCache() {
    //根据用户是否第一次来到这个页面来判断是否显示引导
    //判断依据：用户来过了会留下cookie，根据cookie判断
    var key1 = "GJ65SDEFU1203TCHK1";
    var cookieVal1 = $.cookie(key1);
    if (!cookieVal1) {
        $("#ts1").show();
    }
    var key2 = "GJ65SDEFU1203TCHK2";
    var cookieVal2 = $.cookie(key2);
    if (!cookieVal2) {
        $("#ts2").show();
    }
}